//
//  GGZFBHomeViewController.m
//  Gunterapple
//
//  Created by 热带雨林 on 2020/4/1.
//  Copyright © 2020 热带雨林. All rights reserved.
//

#import "GGZFBHomeViewController.h"
#import "GGHomeTopView.h"
#import "GGXiuViewController.h"
//#import "GGZFBFuntionViewController.h"
#import "GGFuntionView.h"
#import "GGAddtion.h"
@interface GGZFBHomeViewController ()<HomeTopViewDelegate,funtionViewDelegate>
@property (nonatomic,weak)GGHomeTopView *topView;
@end

@implementation GGZFBHomeViewController

- (void)viewWillAppear:(BOOL)animated{
    [super viewWillAppear:animated];
    //导航栏透明
//    [self.navigationController.navigationBar setBackgroundImage:[UIImage new] forBarMetrics:UIBarMetricsDefault];
//    [self.navigationController.navigationBar setShadowImage:[UIImage new]];
}
- (void)viewDidLoad {
    
    [super viewDidLoad];
    self.title = @"首页";
    self.view.backgroundColor = [UIColor whiteColor];
    //适配
    /*
     //适配iOS13
     'statusBarFrame' is deprecated: first deprecated in iOS 13.0 - Use the statusBarManager property of the window scene instead.
     statusBarFrame'已弃用：首先在iOS 13.0中弃用-请改用窗口场景的statusBarManager属性。
     if (@available(iOS 13.0, *)) {
         UIStatusBarManager *statusBarManager = [UIApplication sharedApplication].windows.firstObject.windowScene.statusBarManager;
         statusBarHeight = statusBarManager.statusBarFrame.size.height;
     }
     else {
         statusBarHeight = [UIApplication sharedApplication].statusBarFrame.size.height;
     }
     */
//    GGHomeTopView *topView = [[GGHomeTopView alloc]initWithFrame:CGRectMake(0,  SJHeight, CGRectGetWidth(self.view.frame), 100)];
//    topView.delegate = self;
//    [self.view addSubview:topView];
    
//    GGZFBFuntionViewController *funtionVC = [[GGZFBFuntionViewController alloc]init];
//    [self.view addSubview:funtionVC.view];
//    [funtionVC.view mas_makeConstraints:^(MASConstraintMaker *make) {
//        make.top.equalTo(topView.mas_bottom);
//        make.left.equalTo(self.view);
//        make.size.mas_equalTo(CGSizeMake(GDScreenW, GDScreenH - 100 - IphoneXTabbarH - SJHeight));
//    }];
    GGFuntionView *funtionView =  [[GGFuntionView alloc]initWithFrame:CGRectMake(0, SJHeight, GDScreenW, GDScreenH - SJHeight - IphoneXTabbarH)];
    funtionView.delegate = self;
    [self.view addSubview:funtionView];
}
- (void)funtionViewWithType:(NSInteger)type{
    switch (type) {
        case 1:{
            
        }
            break;
        case 2:{
            
        }
            break;
        case 3:{
            
        }
            break;
        case 4:{
            GGXiuViewController *xiuVC = [[GGXiuViewController alloc]init];
            [self.navigationController pushViewController:xiuVC animated:YES];
        }
            break;
        default:
            break;
    }
}
//- (void)clickBtnWithType:(NSInteger)type{
//    switch (type) {
//        case btnScan:{
//            
//        }
//            break;
//        case btnCard:{
//            
//        }
//            break;
//        case btnPay:{
//            
//        }
//            break;
//        case btnXiu:{
//            GGXiuViewController *xiuVC = [[GGXiuViewController alloc]init];
//            [self.navigationController pushViewController:xiuVC animated:YES];
//        }
//            break;
//        default:
//            break;
//    }
//}
/*
#pragma mark - Navigation

// In a storyboard-based application, you will often want to do a little preparation before navigation
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
    // Get the new view controller using [segue destinationViewController].
    // Pass the selected object to the new view controller.
}
*/

@end
